<script>
	import {getToken,getUser} from 'utils/auth.js'
	export default {
		onLaunch: function() {
			const token = getToken()
			const user = getUser()
			if(token && user.username) {
				uni.switchTab({
					url:'/pages/message/message'
				})
			}else {
				uni.reLaunch({
					url:'/pages/login/login'
				})
			}
		},
		onShow: function() {
			
		},
		onHide: function() {
			
		}
	}
</script>

<style>
	/*每个页面公共css */
	page{
		height: 100%;
	}
	.app-container{
		height: 100%;
		background-color: #f8f8f8;
	}
	.icon{
		width: 20px;
		height: 20px;
	}
	.icon-friend{
		width: 30px;
		height: 30px;
		border-radius: 5px;
		background-color: #fff;
		overflow: hidden;
	}
	.icon-avatar{
		width: 40px;
		height: 40px;
		border-radius: 5px;
		background-color: #fff;
		overflow: hidden;
	}
</style>
